package com.freeland.client2009.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.freeland.client2009.dao.ibatis.UserInfoDAO;
import com.freeland.client2009.dao.ibatis.model.UserInfo;
import com.freeland.client2009.service.UserInfoService;

@Service("userInfoService")
@Transactional
public class UserInfoServiceImpl implements UserInfoService {

	@Autowired
	private UserInfoDAO userInfoDao;
	
	public int saveUser(UserInfo userInfo) {
		userInfoDao.insert(userInfo);
		return userInfo==null?0:1;
	}

	public int updateUser(UserInfo userInfo) {
		userInfoDao.updateByPrimaryKeySelective(userInfo);
		return userInfo==null?0:1;
	}
	
	public UserInfo getUserInfo(UserInfo userInfo){
		return userInfoDao.selectByPrimaryKey(userInfo);
	}

}
